package com.dxyxx.framework;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import br.com.pierry.simpletoast.SimpleToast;

import com.dxyxx.R;
import com.ta.utdid2.android.utils.StringUtils;

public class FeedbackActivity extends Activity {
	private EditText text;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.setting_feedback);
		initView();

	}

	private void initView() {
		ImageView homeButton = ((ImageView) findViewById(R.id.backImageButton));
		homeButton.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		text = (EditText) findViewById(R.id.editText);
		ImageView nextButton = ((ImageView) findViewById(R.id.nextImageButton));
		nextButton.setVisibility(View.INVISIBLE);
		findViewById(R.id.b_feedback).setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				if (StringUtils.isEmpty(text.getText().toString())) {
					SimpleToast.error(FeedbackActivity.this, "请填写内容！");
					return;
				}
				SimpleToast.ok(FeedbackActivity.this, "提交成功，谢谢您的反馈!\n\n我们努力做到最好。");
				finish();
			}
		});

		((TextView) findViewById(R.id.title)).setText("帮助与反馈");
	}
}
